styleproperty: Move property_parse_func member
authorBenjamin Otte <otte@redhat.com>
Mon, 2 Jan 2012 09:41:41 +0000 (10:41 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 9 Jan 2012 17:37:55 +0000 (18:37 +0100)
It belongs in GtkCssCustomProperty

gtk/gtkcsscustomproperty.c
gtk/gtkcsscustompropertyprivate.h
gtk/gtkstylepropertyprivate.h

index bb9aa415acb77b43193b3ca25652aa016f2b8b29..9d4c61f47cc8d8d52ff0b45da0c3d14b67c5f458 100644 (file)
@@ -35,11 +35,12 @@ gtk_css_custom_property_parse_value (GtkStyleProperty *property,
                                      GtkCssParser     *parser,
                                      GFile            *base)
 {
+  GtkCssCustomProperty *custom = GTK_CSS_CUSTOM_PROPERTY (property);
   gboolean success;
 
   g_value_init (value, _gtk_style_property_get_value_type (property));
 
-  if (property->property_parse_func)
+  if (custom->property_parse_func)
     {
       GError *error = NULL;
       char *value_str;
@@ -47,7 +48,7 @@ gtk_css_custom_property_parse_value (GtkStyleProperty *property,
       value_str = _gtk_css_parser_read_value (parser);
       if (value_str != NULL)
         {
-          success = (*property->property_parse_func) (value_str, value, &error);
+          success = (* custom->property_parse_func) (value_str, value, &error);
           g_free (value_str);
         }
       else
@@ -147,7 +148,7 @@ gtk_theming_engine_register_property (const gchar            *name_space,
                                       GtkStylePropertyParser  parse_func,
                                       GParamSpec             *pspec)
 {
-  GtkStyleProperty *node;
+  GtkCssCustomProperty *node;
   GValue initial = { 0, };
   gchar *name;
 
@@ -186,7 +187,7 @@ void
 gtk_style_properties_register_property (GtkStylePropertyParser  parse_func,
                                         GParamSpec             *pspec)
 {
-  GtkStyleProperty *node;
+  GtkCssCustomProperty *node;
   GValue initial = { 0, };
 
   g_return_if_fail (G_IS_PARAM_SPEC (pspec));
@@ -232,11 +233,13 @@ gtk_style_properties_lookup_property (const gchar             *property_name,
 
   if (GTK_IS_CSS_CUSTOM_PROPERTY (node))
     {
+      GtkCssCustomProperty *custom = GTK_CSS_CUSTOM_PROPERTY (node);
+
       if (pspec)
         *pspec = GTK_CSS_STYLE_PROPERTY (node)->pspec;
 
       if (parse_func)
-        *parse_func = node->property_parse_func;
+        *parse_func = custom->property_parse_func;
 
       found = TRUE;
     }
index 483dd6da0d8250f35894514d1350bace9085b4c4..e4eb364de1fd163aae2cf5c0c419eeeada9bc63e 100644 (file)
@@ -38,6 +38,8 @@ typedef struct _GtkCssCustomPropertyClass      GtkCssCustomPropertyClass;
 struct _GtkCssCustomProperty
 {
   GtkCssStyleProperty parent;
+
+  GtkStylePropertyParser property_parse_func;
 };
 
 struct _GtkCssCustomPropertyClass
index 60701992ad9260ce87e32ec12f9cf44a4f0eef3e..b2c7b924df967b278f111fcd7b3b304ed9446821 100644 (file)
@@ -58,7 +58,6 @@ struct _GtkStyleProperty
   char *name;
   GType value_type;
 
-  GtkStylePropertyParser    property_parse_func;
   GtkStyleUnpackFunc        unpack_func;
   GtkStylePackFunc          pack_func;
   GtkStyleParseFunc         parse_func;